package com.yxhl.zoume.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by vhawk on 15/10/15.
 * 正则判断
 */
public class RegexUtils {

    public static boolean isValidMobile(String mobile) {
        Pattern p = Pattern.compile("^1[3|4|5|7|8][0-9]\\d{8}$");
        Matcher m = p.matcher(mobile);
        return m.matches();
    }

    public static boolean isValidRealname(String realname) {
        Pattern p = Pattern.compile("^[\\u4e00-\\u9fa5]{2,4}$|^[A-Za-z]+$");
        Matcher m = p.matcher(realname);
        return m.matches();
    }
}
